<?php

/** 
* 
* 
* by:南宁火蝶科技有限公司 http:///www.HdsysCms.com
* 声明:本系统禁止用二次开发、侵犯HdsysCms著作和除去HdsysCms进行售卖,如发现将追究一切权利,模版制作属于自己所得可以通过本系统对外开发模版获取收益!
* 
* 2019年第一版本发布 - 到2023.9.1开源使用! 
* php混淆工具:phpencry.wbox.top
* 
* 注意防骗:@HdsysCms 官方没授权任何个人机构合作,唯一收款抬头:《南宁火蝶科技有限公司》和官网显示客服唯一渠道客服,其它渠道以HdsysCms名义行为均骗子!
*
*/
	

defined('HDSYS_SET') or call_my_die(''.'Not,This File Not Can in Ie Open');
if (HDSYS_SET!='ADMIN') {
call_my_die("".'访问路径错误');
}
class Linke
{
public function __construct()
{
$this->intelligence_session=bs_lib::load_libhdsys_class("".'session');
$this->intelligence_session->intelligence_session_open();
$this->intelligence_db=bs_lib::load_libhdsys_class(templates_Verifications_db());
$this->purconfig=bs_lib::load_libhdsys_class('purconfig');
bs_lib::load_modules_common();
isadminlogin();
}
public function call_table(){
include bs_lib::load_default_path();
}
public function call_add(){
include bs_lib::load_default_path();
}
public function call_add_ajax()
{
$urlname=set_post("".'urlname');
$url=set_post("".'url');
$eurlname=set_post("".'eurlname');
$eurl=set_post("".'eurl');
if ($urlname=='' and $url=='') {
print_json(array(call_my_str_code()=>call_my_int_aeg1(),call_my_str_msg()=>'中文名称和URl不能空'));
}
$param_tmp=$this->intelligence_db->intelligence_insert('hdsys_links', array('urlname'=>$urlname,'url'=>$url,'eurlname'=>$eurlname,'eurl'=>$eurl));
if ($param_tmp) {
print_json(array(call_my_str_code()=>call_my_int_1(),call_my_str_msg()=>'添加成功'));
} else {
print_json(array(call_my_str_code()=>call_my_int_aeg1(),call_my_str_msg()=>'添加失败'));
}
}
public function call_table_ajax()
{
$param_FANYE=(int)set_get('page');
if ($param_FANYE>0) {
$param_db_ID=$param_FANYE-1;
} else {
$param_db_ID=0;
$param_FANYE=1;
}
$param_shu=set_get('limit');
if ($param_shu==0) {
$param_shu=10;
}
$param_db_ID=$param_db_ID*$param_shu;
$param_soso=set_get('soso');
$param_soso_id=(int)set_get('soso_id');
$param_DESC_id=(int)set_get('DESC');
$param_soso_id > 0 ? $param_soso_id_show=$param_soso_id - 1 : $param_soso_id_show=0;
$param_DESC_id==1 ? $param_DESC='ASC' : $param_DESC='DESC';
$param_sql="SELECT*FROM`hdsys_links`WHERE `urlname`LIKE '%{$param_soso}%' ORDER BY`sort`{$param_DESC} LIMIT {$param_db_ID},{$param_shu}";
$param_db_array_value=$this->intelligence_db->intelligence_query($param_sql);
$param_sql="select count(*)as 'hangshu' from`hdsys_links` WHERE `urlname`LIKE '%{$param_soso}%'";
$param_tmp_arr=$this->intelligence_db->intelligence_array($param_sql);
$param_tmp_rows=(int)$param_tmp_arr['hangshu'];
$param_while_array_list_all=array();
while ($param_value=$this->intelligence_db->intelligence_assoc($param_db_array_value)) {
$param_while_array_list_all[]=$param_value;
}
$param_json_array=array();
$param_json_array[call_my_str_data()]=(array) $param_while_array_list_all;
$param_json_array[call_my_str_code()]=0;
$param_json_array[call_my_str_msg()]='';
$param_json_array[call_my_str_count()]=$param_tmp_rows;
print_json($param_json_array);
}
public function call_del_ajax()
{
$param_id=set_post("".'id');
$param_sql="DELETE FROM `hdsys_links` WHERE `id`='{$param_id}'";
$param_tmp=$this->intelligence_db->intelligence_query($param_sql);
if ($param_tmp) {
print_json(array(call_my_str_code()=>call_my_int_1(),call_my_str_msg()=>'删除成功'));
} else {
print_json(array(call_my_str_code()=>call_my_int_aeg1(),call_my_str_msg()=>'删除失败'));
}
}
public function call_edit_ajax(){
$param_id=set_post("".'id');
$field=set_post("".'field');
$param_sql="UPDATE `hdsys_links` SET `sort`='{$field}' WHERE `hdsys_links`.`id`='{$param_id}';";
$param_tmp=$this->intelligence_db->intelligence_query($param_sql);
if ($param_tmp) {
print_json(array(call_my_str_code()=>call_my_int_1(),call_my_str_msg()=>'修改成功'));
} else {
print_json(array(call_my_str_code()=>call_my_int_aeg1(),call_my_str_msg()=>'修改失败'));
}
}
}